Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove the widen type #193

Merged
merged 2 commits into from
Aug 22, 2024
Merged

refactor: remove the widen type #193

merged 2 commits into from
Aug 22, 2024

Conversation

andreas-karlsson
Copy link
Contributor

Hi There, I just made a Pull Request!

This PR removes the "Widen" type which was there as a fix for return types being referred too narrowly. For instance the return value of getFlag should be of the same type as the default value arg. But if you called getFlag with a 3 as the default value the inferred return type would be 3 instead of number. The Widen type caused some unnecessary complexity though, and now the problem is fixed with overloads instead.

✔️ Checklist

  • All tests are passing
  • Relevant documentation updated
  • linter/style run on changed files
  • Tests added for new functionality
  • Regression tests added for bug fixes
  • Tested in a corresponding example app

@andreas-karlsson andreas-karlsson merged commit 99c9659 into main Aug 22, 2024
2 checks passed
@andreas-karlsson andreas-karlsson deleted the refactor-widen branch August 22, 2024 15:49
@github-actions github-actions bot mentioned this pull request Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants